/**
 * 
 */
package com.gome.axwl.aoc.service.feign.fallback;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;


import com.anxl.sso.client.api.Account;
import com.anxl.sso.client.api.AccountInfo;
import com.github.pagehelper.PageInfo;
import com.gome.axwl.aoc.entity.driver.CarrierFromMasterDto;
import com.gome.axwl.aoc.entity.driver.DriverAccount;
import com.gome.axwl.aoc.entity.driver.DriverWithCarrierDto;
import com.gome.axwl.aoc.service.feign.MasterDataFeignClient;
import com.gome.commons.core.ErrorCode;
import com.gome.commons.core.ResultData;

/**   
*    
* 项目名称：gome-axwl.op-service   
* 类名称：MasterDataFeignFallBack
* 类描述：   
* 创建人：chengh
* 创建时间：2018-4-25 09:50:47
* @version        
*/
@Component
public class MasterDataFeignFallBack implements MasterDataFeignClient {

	private final static Logger log = LoggerFactory.getLogger(MasterDataFeignFallBack.class);
	/**
	 * 查询服务商信息降级处理
	 * @param keyword
	 * @return
	 */
	@Override
	public ResultData<List<CarrierFromMasterDto>> QueryCarrierByKeyword(String keyword, String dcId) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryCarrier4Select}服务有异常，请查看服务是否正常!");
	}

	/**
	 * 查询司机信息降级处理
	 * @param keyword
	 * @return
	 */
	@Override
	public ResultData QueryDriverByKeyword(String keyword,String dcId) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriver4Select}服务有异常，请查看服务是否正常!");

	}

	/**
	 * 查询用的DC编码
	 * @param accountNo
	 * @return
	 */
	@Override
	public ResultData getDcCodeByAccountNo(String accountNo) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriver4Select}服务有异常，请查看服务是否正常!");
	}

	/**
	 * 查询DC信息集合
	 * @param list
	 * @return
	 */
	@Override
	public ResultData<Map<String, Object>> getDcByDcCodes(List<String> list) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriver4Select}服务有异常，请查看服务是否正常!");
	}

	/**
	 * 获取Dc下的用户
	 * @param list
	 * @return
	 */
	@Override
	public ResultData<List<DriverAccount>> getDriversByDcCodes(List<String> list) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriver4Select}服务有异常，请查看服务是否正常!");
	}

	/**
	 * 根据driverNo获取司机详情
	 * @param driverNo
	 * @return
	 */
	@Override
	public ResultData<DriverWithCarrierDto> queryDriverDetail(String driverNo) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriverDetail}服务有异常，请查看服务是否正常!");
	}

	@Override
	public ResultData<PageInfo<DriverWithCarrierDto>> queryDriver(Integer driverId, Integer pageNum, Integer pageSize) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryDriver}服务有异常，请查看服务是否正常!");
	}

	@Override
	public ResultData<PageInfo<DriverWithCarrierDto>> screenDriver(String driverNo, String driverName, String carrierNo, Integer pageNum, Integer pageSize) {
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{screenDriver}服务有异常，请查看服务是否正常!");
	}

	@Override
	public ResultData<AccountInfo> getUserByAccountNo(@RequestParam("accountNo") String accountNo){
		log.error("[MASTER]查询主数据接口{screenDriver}, 参数:{} 异常！", accountNo);
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{screenDriver}服务有异常，请查看服务是否正常!");
	}

	@Override
	public ResultData<List<AccountInfo>> getAccountListByInviteCodes(List<String> inviteCodes) {
		log.error("[MASTER]查询主数据接口{queryCode}, 参数:{} 异常！", inviteCodes);
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryCode}服务有异常，请查看服务是否正常!");
	}

    @Override
    public ResultData<List<Account>> queryAccountByKeyword(String keyword) {
        log.error("[MASTER]查询主数据接口{queryAccountByKeyword}, 参数:{} 异常！", keyword);
        return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryAccountByKeyword}服务有异常，请查看服务是否正常!");
    }


	@Override
	public ResultData<List<Account>> queryInviteCode(String keyword) {
		log.error("[MASTER]查询主数据接口{queryInviteCode}, 参数:{} 异常！", keyword);
		return ResultData.newResultData(ErrorCode.FAILOR, "调用主数据接口{queryInviteCode}服务有异常，请查看服务是否正常!");
	}

}
